home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Book Chapters / 10 - Networking / NovelNetwar / cursors.c < prev    next >
Text File  |  1995-05-12  |  797b  |  76 lines

  1. //    This module takes care of setting the cursor appearance.
  2.  
  3. #include "NovelNetwar.h"
  4.  
  5.  
  6. #define    kSysEnvironsVersion 1
  7.  
  8.  
  9.  
  10. static Cursor            waitCursor;
  11. static Cursor            lastCursor;
  12. static SysEnvRec        gMac;
  13.  
  14.  
  15. void cursorsInit(void)
  16. {
  17.     lastCursor = qd.arrow;
  18. }
  19.  
  20.  
  21.  
  22.  
  23. void cursorsStartup(void)
  24. {
  25. CursHandle        hCurs;
  26. CCrsrHandle        hCrsr;
  27.  
  28.  
  29.  
  30.     hCurs = 0L;
  31.     
  32.     hCurs = GetCursor(watchCursor);
  33.     
  34.     if (hCurs)
  35.     {
  36.         waitCursor = **hCurs;
  37.     }
  38.     
  39.     
  40.     
  41.     
  42.     SysEnvirons(kSysEnvironsVersion, &gMac);
  43. }
  44.  
  45.  
  46.  
  47. void cursorsMaintainCursor(Point theMousePt)
  48. {
  49.     if (IAmFrontApp)
  50.     {
  51.         SetCursor(&(qd.arrow));
  52.     }
  53. }
  54.  
  55.  
  56.  
  57.  
  58. void cursorsShutDown(void)
  59. {
  60.  
  61. }
  62.  
  63.  
  64.  
  65.  
  66. void cursorReactToMouseClick(Point theMousePt)
  67. {
  68. int        theOwner;
  69.  
  70.     if (IAmFrontApp && IsOurWindow(FrontWindow()) == noErr)
  71.     {
  72.         SetCursor(&(qd.arrow));
  73.         
  74.         lastCursor = qd.arrow;
  75.     }
  76. }